#include <cstdio>
const int maxn = 40;
char s[maxn];
char a, b;

/**
 * 字符替换
 * 
 * 
 */
int main() {
    scanf("%s %c %c", s, &a, &b);
    for (int i = 0; s[i]; ++i) {
        if (s[i] == a) {
            s[i] = b;
        }
    }
    printf("%s\n", s);
    return 0;
}